home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
wgt_tp1.zip
/
COMMANDS.DOC
< prev
next >
Wrap
Text File
|
1992-07-05
|
32KB
|
907 lines
WordUp Graphics Toolkit
Command Summary
_Bar procedure
------------------------------------------------------------------------------
Function 1 Draws a filled rectangle with current color on active graphics
page.
Declaration _Bar(x1,y1,x2,y2 : INTEGER)
Remarks See _Rectangle.
Block_Height function
------------------------------------------------------------------------------
Function Returns height of a previously stored block.
Declaration Block_Height(blockname : POINTER)
Result Type Integer
Block_Width function
------------------------------------------------------------------------------
Function Returns width of a previously stored block.
Declaration Block_Width(blockname : POINTER)
Result Type Integer
_Circle procedure
------------------------------------------------------------------------------
Function Draws a circle using (x,y) as the center point.
Operates on current color and graphics page.
Declaration _Circle(x,y,radius : INTEGER)
Remarks The circle is drawn using the current color set by _SetColor.
Aspect ratios are not used, therefore results may be slightly
different than the BGI counterpart.
See also _SetColor, Filled_Circle
_ClearDevice procedure
------------------------------------------------------------------------------
Function Clears the currently selected graphics page with a specified
color number.
Declaration _ClearDevice(color : BYTE)
Remarks This command behaves like the BGI ClearDevice procedure except
that it allows you to use a certain "clearing" color and it
supports WGT's multiple graphics pages.
Restrictions Does not handle clipping.
See also Currentscreen variable, _ClearViewPort procedure
_ClearViewPort procedure
------------------------------------------------------------------------------
Function Clear the currently selected graphics page with a specified
color number (only within clipping boundaries).
Declaration _ClearViewPort(color : BYTE)
Remarks Same as _ClearDevice except it operates with clipping ranges.
See also _ClearDevice, _SetViewPort
Color_Rotate procedure
------------------------------------------------------------------------------
Function Cycles the colors within a specified group from a palette
variable.
Declaration Color_Rotate(start,finish : WORD; dir : DIRECTIONS;
VAR pal : PALETTE)
Remarks This routine takes the colors from Start to Finish and shifts
them one in the direction specified by DIR. This effect can
be used to similate animation. DIRECTIONS is a variable type
available only for WGT and cannot be used in standard TP. It
is defined as follows:
TYPE Directions = (up, down, left, right)
Up and Left are treated as the same thing, as are Down and
Left (all four are used for scrolling screen sections).
See also _SetRGBPalette, Fade_In, Fade_Out
Copy_Screen procedure
------------------------------------------------------------------------------
Function Copies a section of one screen onto a different WGT page.
Declaration Copy_Screen(x1,y1,x2,y2 : INTEGER; source : SCREENPTR;
dx,dy : INTEGER; dest : POINTER)
Remarks This command can seem confusing, but is very powerful, and
necessary when using multiple graphics pages. A second page
must be initialized with Init_Screen before this command can
be used.
The area defined by (x1,y1,x2,y2) is copied from the screen
described by SOURCE, and is placed with the upper left corner
at (dx,dy) on the screen referred to by DEST. For example,
to copy screen SECOND(entirely) to the visual screen, type
Copy_Screen(0,0,319,199,SECOND,0,0,BASESCREEN). Basescreen is
a constant which is used to describe the visual screen.
See also Init_Screen, Patches, Remove_Screen
Fade_In procedure
------------------------------------------------------------------------------
Function Gradually fades in a group of colors from a palette variable
(using a specified speed).
Declaration Fade_In(start,finish : WORD; pal : PALETTE; speed : BYTE)
Remarks The colors from Start to Finish are faded in starting from
black. The speed may range from (0..255), and is similar to
using the DELAY command between each change of the colors.
See also Fade_Out, _SetRGBPalette, Set_Palette_Block
Fade_Out procedure
------------------------------------------------------------------------------
Function Gradually fades out a group of colors from a palette variable
(using a specified speed).
Declaration Fade_Out(start,finish : WORD; pal : PALETTE; speed : BYTE)
Remarks Same as Fade_In except colors result in black.
See also Fade_In, _SetRGBPalette, Set_Palette_Block
Filled_Circle procedure
------------------------------------------------------------------------------
Function Draws a filled circle using (x,y) as the center point.
Declaration Filled_Circle(x,y,radius : INTEGER)
Remarks See _Circle
Flip_Block procedure
------------------------------------------------------------------------------
Function Flips a block in one of two directions (block is physically
changed in memory, not on screen).
Declaration Flip_Block(VAR blockname : POINTER; flipdir : FLIP)
Remarks This procedure will flip a previously stored image either
vertically or horizontally. The stored image is physically
changed, and therefore the results will not be seen until
the block is displayed.
FLIP is a variable type which is exclusive to WGT and may
not be used otherwise. It is defined as follows:
TYPE flip = (Horizontal, Vertical)
See also Put_Block, New_Block, Resize_Block, Free_Block
Free_Block procedure
------------------------------------------------------------------------------
Function Releases memory used to store an image.
Declaration Free_Block(VAR blockname : POINTER)
Remarks Used when a program is finished with a stored image. This is
similar to the BGI FREEMEM.
See also New_Block
FreeSprites procedure
------------------------------------------------------------------------------
Function De-allocates the memory used by LOADSPRITES.
Declaration FreeSprites(VAR block : SPRITES)
Remarks Removes sprites from memory.
See Also LoadSprites
_GetPixel function
------------------------------------------------------------------------------
Function Gets the pixel value at X,Y. Uses current graphics page.
Declaration _GetPixel(x,y : INTEGER);
Result Type Word
See also _PutPixel
Get_Transluscent function
------------------------------------------------------------------------------
Function Returns current transluscent color used by PutBlock.
Declaration Get_Transluscent
Result Type Byte
Remarks See Set_Transluscent.
See also Put_Block, Set_Transluscent
Init_Screen procedure
------------------------------------------------------------------------------
Function Initializes a 64K block of memory to act as a graphics page.
Declaration Init_Screen(VAR screenname : SCREENPTR);
Remarks This is the closest available to page flipping techniques for
this graphics mode. All graphics operations in WGT work on the
pages created by this procedure. A variable must be set by
your program to tell WGT which screen to use. To do so,
type CURRENTSCREEN:= and then the name of the pointer to the
other screen. BGI functions do not work on these screens.
See also Copy_Screen, Patches, Remove_Screen
_Line Procedure
------------------------------------------------------------------------------
Function Draws a line on the current graphics page from (x1,y1) to
(x2,y2). Operates on current color and graphics page.
Declaration _Line(x1,y1,x2,y2 : INTEGER)
Remarks Replaces all needs for BGI's line command except where a
line style other than SolidLn is required. Horizontal lines
are significantly faster than BGI's.
Restrictions Does not allow for different line styles or thicknesses.
See also _Setcolor
Load_Block procedure
------------------------------------------------------------------------------
Function Loads a previously saved image from disk into a pointer.
Declaration Load_Block(filename : STRING; VAR blockname : POINTER)
Remarks The pointer must be set to NIL before this routine is called.
Load_Block automatically initializes the appropriate amount
of memory and loads the data. There is no need for a call
to New_Block (in fact, don't do it or this won't work).
See also Save_Block
LoadPAK procedure
------------------------------------------------------------------------------
Function Loads a previously stored image from disk in compressed
format.
Declaration LoadPAK(filename : STRING; VAR blockname : POINTER)
Remarks This is similar to Load_Block except that the image is
in a file which was created by SavePAK. The compression used
is "similar" to PCX format (sometimes better). The more
simplistic the image, the smaller the file.
See also SavePAK, Load_Block
Load_Palette procedure
------------------------------------------------------------------------------
Function Load a 768 byte palette file from disk into a palette
variable.
Declaration Load_Palette(filename : STRING; VAR pal : PALETTE)
Remarks Palette files created by WGT or popular graphics programs may
be loaded into the variable specified by PAL. Changes are not
made to the currently displayed palette. A call to
Set_Palette_Block is required to do so. A good example of
compatibility would be the AutoDesk Animator. It's .COL files
are of this type. Many commercial games use these files as
well.
See also Save_Palette, Set_Palette_Block, _SetRGBPalette
LoadPCX procedure
------------------------------------------------------------------------------
Function Loads a PCX file (320*200*256 only) onto the current graphics
page.
Declaration LoadPCX(filename : STRING)
Remarks Currently very limited flexibility. Palette files must be
loaded separately using Load_Palette. Improved capabilities
should be available by the time you read this.
LoadSprites procedure
------------------------------------------------------------------------------
Function Loads a sprite file created by WGT Sprite Creator.
Declaration LoadSprites(filename : STRING; VAR p : palette;
VAR block : sprites)
Remarks This loads a sprite file created by the WGT Sprite Creator
into a palette variable and a variable of type SPRITES.
The palette is merely loaded into P, not set. The sprite
data is stored as separate blocks, referenced by the variable
BLOCK. The type SPRITES is defined as follows:
TYPE sprites = ARRAY [1..100] OF POINTER
The sprite may be displayed by using PUT_BLOCK. For example,
to show sprite number 54, use
PUT_BLOCK(0,0,block[54],normalput);
If a pointer is set to NIL then there is no sprite in that
location (ex. BLOCK[54]=NIL)
See Also FreeSprites, Put_Block
Mouse procedure
------------------------------------------------------------------------------
Function Returns the current button pressed, as well as X and Y
coordinates.
Declaration Mouse(VAR x,y,button : INTEGER)
Remarks Buttons are commonly returned as 1 for left, 2 for right,
and 4 for the middle button of a 3 button mouse. 0 is returned
if none are pressed.
See also Mouse_Init, Mouse_Range, Mouse_On, Mouse_Off, Mouse_Cursor
Mouse_Cursor procedure
------------------------------------------------------------------------------
Function Sets the bitmap and hotspot of the mouse cursor.
Declaration Mouse_Cursor(rowhot,colhot : INTEGER; VAR bitmap : MOUSEMAP)
Remarks This procedure sets the cursor hotspot as defined by the
variables ROWHOT and COLHOT. Each are in the range (0..15).
The actual bitmap information is stored in an array of
variable type MOUSEMAP. It is defined as follows:
TYPE mousemap = ARRAY [0..31] OF WORD;
The first 16 words are used to set the cursor shape, while the
last 16 words set the mask. Several shareware programs are
available to create the data required for these cursors if
you are unfamiliar with bit operations.
Mouse_Init procedure
------------------------------------------------------------------------------
Function Initializes the mouse and return # of buttons if installed.
Declaration Mouse_Init(VAR installed : BOOLEAN; VAR buttons : INTEGER)
Remarks Two variables are passed to this function. The first one will
return TRUE if a mouse is installed. The second will return
the # of buttons on the mouse if one is present.
See also Mouse_Range, Mouse_On, Mouse_Off, Mouse, Mouse_Cursor
Mouse_Off procedure
------------------------------------------------------------------------------
Function Turns off display of the mouse cursor.
Declaration Mouse_Off
Remarks See Mouse_On.
See also Mouse_Init, Mouse_Range, Mouse_On, Mouse, Mouse_Cursor
Mouse_On procedure
------------------------------------------------------------------------------
Function Displays the mouse cursor.
Declaration Mouse_On
Remarks If the mouse is displayed, it may affect some graphics output
procedures. Turn it off if it causes problems.
See also Mouse_Init, Mouse_Range, Mouse_Off, Mouse, Mouse_Cursor
Mouse_Range procedure
------------------------------------------------------------------------------
Function Sets the area to confine the mouse cursor to.
Declaration Mouse_Range(minx,miny,maxx,maxy : INTEGER)
Remarks The cursor will be restricted movement within the specified
region after this routine is called.
See also Mouse_Init, Mouse_On, Mouse_Off, Mouse, Mouse_Cursor
Mouse_SetXY procedure
------------------------------------------------------------------------------
Function Positions the mouse cursor.
Declaration Mouse_SetXY(x,y : INTEGER)
Remarks Places the mouse cursor at location (X,Y).
See Also Mouse_Init, Mouse_On, Mouse_Off, Mouse_Cursor, Mouse,
Mouse_Range
New_Block procedure
------------------------------------------------------------------------------
Function Stores a section of the screen in memory at a location pointed
to by a pointer variable.
Declaration New_Block(x1,y1,x2,y2 : INTEGER; VAR blockname : POINTER)
Remarks The pointer must be set to NIL before this routine is called.
Dynamic memory is used to automatically calculate the size of
the data, and to store it in a format compatible with BGI's
GETIMAGE. This procedure replaces the need for the combination
of IMAGESIZE, GETMEM, and GETIMAGE used in the BGI (although
each of WGT's block commands may be used interchangeably with
the BGI versions). Simply set a pointer to NIL and call this
routine.
See also Block_Width, Block_Height, Flip_Block, Put_Block, Resize_Block,
Free_Block, Load_Block, Save_Block, LoadPAK, SavePAK
_OutTextXY procedure
------------------------------------------------------------------------------
Function Outputs a string of text on the graphics page at (x,y).
Declaration _OutTextXY(x,y : INTEGER; s : STRING)
Remarks Same as BGI version except it works on any graphics page.
X/Y coordinate system may be 40*25 or 320*200 (see the
TextGrid procedure).
See also _TextColor, _TextBackground, TextGrid, TextTransparent,
TextCursor, TextInput
Patches procedure
------------------------------------------------------------------------------
Function Dissolves a screen of memory onto the visual screen.
Declaration Patches(mode : INTEGER; VAR source : POINTER; speed : WORD)
Remarks The screen described by SOURCE is dissovled onto the visual
screen using small blocks (copied randomly). The resolution
of these blocks varies with the number specified by MODE.
The higher the mode, the more blocks are required to fill
the screen. The screen will be divided into sections of 2*2
to 80*50. The MODE must be in the range (0..7). The speed is
a DELAY command after each block is copied.
Put_Block procedure
------------------------------------------------------------------------------
Function Plots a previously stored image on the current graphics page.
Declaration Put_Block(x,y : INTEGER; VAR blockname : POINTER;
method : BLOCKMODE)
Remarks This is similar to the BGI PUTIMAGE. It displays an image
starting from the upper left corner at (x,y). Two modes are
supported for the method. They are:
TYPE blockmode = (NormalPut, XRayPut)
The XRayPut uses the current transluscent color as a sort of
"see-through" color. Any occurence of this color is not
drawn on the screen.
See also Set_Transluscent, Get_Transluscent, New_Block
_PutPixel procedure
-------------------------------------------------------------------------------
Function Plots a pixel at X,Y. Operates on current graphics page.
Declaration _Putpixel(x,y : INTEGER; pixel : BYTE)
Remarks Plots a point in the color defined by Pixel at (x,y).
See also _GetPixel
_Rectangle procedure
------------------------------------------------------------------------------
Function Draws a rectangle using the current color and graphics page.
Declaration _Rectangle(x1,y1,x2,y2 : INTEGER)
Remarks (x1,y1) define the upper left corner of the rectangle, and
(x2,y2) define the lower right. Faster than BGI equivalent.
See also _SetColor, _Bar
RegionFill procedure
------------------------------------------------------------------------------
Function Fills an area of the screen bounded by any color other than
that located at (x,y).
Declaration RegionFill(x,y : INTEGER)
Remarks Much more useful than the BGI FloodFill routine. It allows
multiple colors to be used as the border color. It also
utilizes dynamic memory allocation to provide its own
'floating stack'. This means that it will fill as much of the
screen as it can using available memory, and then it will
release the memory. If the full area is not filled, try using
the compiler directive {$M 65520,16384,655360} to use all
possible memory.
See also _SetColor
Remove_Screen procedure
------------------------------------------------------------------------------
Function Releases the memory used by a graphics page.
Declaration Remove_Screen(VAR screenname : SCREENPTR)
Remarks Used to free the memory reserved by a Init_Screen command.
See also Init_Screen
Resize_Block procedure
------------------------------------------------------------------------------
Function Draws a previously stored image on the screen to fit within a
given boundary.
Declaration Resize_Block(x1,y1,x2,y1 : INTEGER; blockname : POINTER)
Remarks A very fast shrink/expand routine for blocks. It will redraw
an image to fit perfectly within the area defined by
(x1,y1,x2,y2). In this manner, entire screens can be shrunk
down as icons, or small images can "explode". Image in memory
is not affected.
Save_Block procedure
------------------------------------------------------------------------------
Function Saves a previously stored image to a file on disk.
Declaration Save_Block(filename : STRING; VAR blockname : POINTER)
Remarks A file is created which holds the data stored at the pointer
given by BLOCKNAME. This allows your programs to load in
images for use later.
See also Load_Block, New_Block, Free_Block
SavePAK procedure
------------------------------------------------------------------------------
Function Saves a previously stored image to disk in a compressed
format.
Declaration SavePAK(filename : STRING; blockname : POINTER)
Remarks This command saves the image referred to by BLOCKNAME to a
disk file. The image is compressed by an algorithm which is
dependent on the image's complexity. The more simplistic the
image, the better the compression.
See also LoadPAK
Save_Palette procedure
------------------------------------------------------------------------------
Function Save a palette variable's contents to a disk file.
Declaration Save_Palette(filename : STRING; VAR pal : PALETTE);
Remarks Creates a 768 byte palette file to disk from a variable
specified by PAL. This is useful for storing different
palettes for games and their various screens.
See also Load_Palette, Set_Palette_Block, _SetRGBPalette
Scroll procedure
------------------------------------------------------------------------------
Function Scrolls a section of the screen in one of 4 directions
Declaration Scroll(x1,y1,x2,y2 : INTEGER; dir : DIRECTIONS; amt : INTEGER)
Remarks Region defined by (x1,y1,x2,y2) is scrolled up,down,left or
right one pixel at a time. This is repeated for the number
of times indicated by AMT. This procedure is not very fast
for large screen sections. The last column or row is not
moved at all, so try not to move borders. For example, if
you move an area down 6, the top row is smeared if it is not
the background color.
TYPE Directions = (up, down, left, right)
_SetColor procedure
------------------------------------------------------------------------------
Function Sets the current drawing color using the palette.
Declaration _SetColor(color : BYTE)
Remarks Color may be in the range (0..255). This sets both the WGT and
the BGI drawing colors, so you never need to use the BGI
version again.
See also Set_Palette_Block, _SetRGBPalette, Load_Palette, Save_Palette
Set_Palette_Block procedure
------------------------------------------------------------------------------
Function Sets a group of colors from a specified palette variable.
Declaration Set_Palette_Block(start,finish : WORD; VAR block : PALETTE)
Remarks Colors from Start to Finish are set using the values stored
in the Palette variable. The variable type PALETTE is specific
to WGT and may not be used elsewhere. It is defined as
follows:
TYPE ColorType = RECORD
R : BYTE;
G : BYTE;
B : BYTE;
END;
Palette = array [0..255] of ColorType;
where R,G, and B are in the range (0..63) giving a total of
256000 color combinations possible. The array may be accessed
individually from (0..255).
See also _SetRGBPalette, Load_Palette, Save_Palette, _SetColor
_SetRGBPalette procedure
------------------------------------------------------------------------------
Function Sets the individual RGB registers of a color number in a
palette variable.
Declaration _SetRGBPalette(color,red,green,blue : BYTE; VAR pal : PALETTE)
Remarks This command is different from the BGI version in that it does
not actually set the color, it only changes the palette
variable. A call to Set_Palette_Block is required to make
changes visible.
See also Set_Palette_Block, _SetColor
Set_Transluscent procedure
------------------------------------------------------------------------------
Function Sets the transluscent color used by Put_Block's XRayPut mode.
Declaration Set_Transluscent(color : BYTE)
Remarks The color set by this function will not be drawn when using
Put_Block with XRayPut.
See also Put_Block, Get_Transluscent
_SetViewPort procedure
------------------------------------------------------------------------------
Function Sets the current clipping area for all graphics pages.
Declaration _SetViewPort(x1,y1,x2,y2 : INTEGER)
Remarks (x1,y1) define the upper left corner of the clipping area,
and (x2,y2) define the lower right. Designated WGT drawing
commands will only draw within this boundary. A call to BGI's
SetViewPort is not required because this procedure also sets
the BGI clipping. Set coordinates to (0,0,319,199) to disable
clipping.
Restrictions See EXTRA.DOC for information concerning which commands are
supported by this function.
_TextBackGround procedure
------------------------------------------------------------------------------
Function Sets the background text color.
Declaration _TextBackground(color : BYTE)
Remarks Color is in the range (0..255). Background may be turned off
for output by using TextTransparent.
See also _OutTextXY, _TextColor, TextTransparent, TextInput
_TextColor procedure
------------------------------------------------------------------------------
Function Selects the foreground character color.
Declaration _TextColor(color : BYTE)
Remarks Color is in the range (0..255). Foreground may be turned off
during output by setting TextTransparent.
See also _OutTextXY, _TextBackGround, TextTransparent, TextInput
TextCursor procedure
------------------------------------------------------------------------------
Function Sets the shape of the text cursor.
Declaration TextCursor(x,y,x2,y2 : BYTE)
Remarks X and Y coordinates are in the range (0..7). The cursor is not
the hardware text cursor, but rather a software simulation.
It is an 8*8 pixel box which flashes during text input. To
make a regular text cursor shape, use (0,7,7,7). A solid box
results from (0,0,7,7). Vertical lines (?) may also be created.
See Also TextInput
TextGrid procedure
------------------------------------------------------------------------------
Function Switches the text addressing system from 320*200 to 40*25.
Declaration TextGrid(state : BOOLEAN)
Remarks Text may be output in regular graphics coordinates (320*200) or
a text mode system of 40*25. If STATE is set to TRUE, all input
and output values for WGT text functions are expected to be
in the 40*25 range. Characters will be 'snapped' to the grid as
if it were a text mode. FALSE will use regular graphics system
coordinates.
See Also _OutTextXY, TextInput
TextInput procedure
------------------------------------------------------------------------------
Function Reads in a string of text from the keyboard and displays
both the text and a simulated cursor on the graphics page.
Declaration TextInput(x,y : INTEGER; format : STRING; VAR result : STRING)
Remarks This simulates a READLN on the graphics screen. This is a
formatted input procedure. The desired format is passed as
a string. It is defined as follows:
Character Function
'*' Allows entry of any ASCII character.
'#' Allows entry of numbers from 0-9.
'.' A hard-coded decimal point not moveable by user.
' ' Output skips over this space in the string.
For example, a format string of '**** ##.##' will accept four
characters of any type, then skip a spot, accept two numbers,
display a period, and then accept another two numbers.
Restrictions INSERT,DELETE,HOME, and the arrow keys are not functional,
backspace is non-destructive. (Future versions will differ).
See Also _TextColor, _TextBackGround, TextGrid, TextTransparent
TextTransparent procedure
------------------------------------------------------------------------------
Function Sets text output to supress display of foreground or
background.
Declaration TextTransparent(noshow : HIDETYPE);
Remarks This will turn off the display of either the foreground or the
background, or set it to show both. The type HIDETYPE is
defined as follows:
TYPE hidetype = (mask, letter, none)
If NOSHOW is set to MASK, the background is turned off. LETTER
turns off the foreground. NONE is used when you want to display
both the foreground and background.